package com.itheima.test;
// 递归求和
public class DiGuiDemo02 {
    public static void main(String[] args) {
        int i = method(100);
        System.out.println(i);
    }

    public static int method(int i){
        if (i == 1){
            return 1;
        }
        return i + method(i-1);
    }
}
